package com.zhs.gccs.utils;

import android.content.Context;
import android.widget.Toast;


/**
 * Created by heyang on 2017/1/5.
 */

public class ToastUtils {

    private Context context;

    private static class SingletonHolder{
        private static final ToastUtils INSTANCE = new ToastUtils();
    }

    private ToastUtils(){}

    public static ToastUtils getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public static void init(Context context){
        getInstance().onInit(context);
    }

    private void onInit(Context context){
        this.context = context;
    }

    public static void toast(String msg){
        Toast.makeText(getInstance().context, msg, Toast.LENGTH_SHORT).show();
    }

    public static void toastL(String msg){
        Toast.makeText(getInstance().context, msg, Toast.LENGTH_LONG).show();
    }

}
